package com.zzk.mainmodule.ui.main;

import androidx.annotation.NonNull;

import com.zzk.rxmvvmbase.base.ItemViewModel;
import com.zzk.rxmvvmbase.binding.command.BindingAction;
import com.zzk.rxmvvmbase.binding.command.BindingCommand;

/**
 *
 * @ProjectName: RXMVVMBaseComponent
 * @Package:
 * @ClassName:
 * @Description:
 * @Author: brilliantzhao
 * @CreateDate: 2021.1.14 9:39
 * @UpdateUser:
 * @UpdateDate: 2021.1.14 9:39
 * @UpdateRemark:
 * @Version: 1.0.0
 */
public class ViewPagerItemViewModel extends ItemViewModel<MainViewModel> {

    public String text;

    public ViewPagerItemViewModel(@NonNull MainViewModel viewModel, String text) {
        super(viewModel);
        this.text = text;
    }

    public BindingCommand onClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            //点击之后将逻辑转到adapter中处理
            viewModel.itemClickEvent.setValue(text);
        }
    });

}
